/**
 * 
 */
package com.infodms.dms.actions.claim.specialExpenses;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;

import com.infodms.dms.actions.common.FileUploadManager;
import com.infodms.dms.bean.AclUserBean;
import com.infodms.dms.bean.SpeciaExpensesBean;
import com.infodms.dms.common.Constant;
import com.infodms.dms.common.ErrorCodeConstant;
import com.infodms.dms.common.Utility;
import com.infodms.dms.common.getCompanyId.GetOemcompanyId;
import com.infodms.dms.dao.claim.specialExpenses.SpecialExpensesManageDao;
import com.infodms.dms.dao.feedbackMng.StandardVipApplyManagerDao;
import com.infodms.dms.exception.BizException;
import com.infodms.dms.po.FsFileuploadPO;
import com.infodms.dms.po.TcCodePO;
import com.infodms.dms.po.TmChananelMileagePO;
import com.infodms.dms.po.TtAsActivityPO;
import com.infodms.dms.po.TtAsWrClaimBalancePO;
import com.infodms.dms.po.TtAsWrCruisePO;
import com.infodms.dms.po.TtAsWrSpefeeAuditingPO;
import com.infodms.dms.po.TtAsWrSpefeeClaimPO;
import com.infodms.dms.po.TtAsWrSpefeePO;
import com.infodms.dms.util.CommonUtils;
import com.infodms.dms.util.StringUtil;
import com.infodms.dms.util.sequenceUitl.SequenceManager;
import com.infoservice.mvc.context.ActionContext;
import com.infoservice.mvc.context.RequestWrapper;
import com.infoservice.po3.bean.PageResult;


/**
 * @Title: SpecialExpensesManage.java
 *
 * @Description:CHANADMS
 *
 * @Copyright: Copyright (c) 2010
 *
 * @Company: www.infoservice.com.cn
 * @Date: 2010-9-18
 *
 * @author lishuai 
 * @mail   lishuai103@yahoo.cn	
 * @version 1.0
 * @remark 
 */
public class SpecialExpensesManage {
	public Logger logger = Logger.getLogger(SpecialExpensesManage.class);
	private SpecialExpensesManageDao dao = SpecialExpensesManageDao.getInstance();
	public static SpecialExpensesManage getInstance() {
		return new SpecialExpensesManage();
	}
	private String initUrl = "/jsp/claim/specialExpenses/speciaExpensesQuery.jsp";//特殊费用提报查询页面
	private String add01Url = "/jsp/claim/specialExpenses/addSpeciaExpenses01.jsp";//新增市场工单
	private String add02Url = "/jsp/claim/specialExpenses/addSpeciaExpenses02.jsp";//新增特殊外出费用
	private String info01Url = "/jsp/claim/specialExpenses/speciaExpensesInfo01.jsp";//详细页 市场工单
	private String info02Url = "/jsp/claim/specialExpenses/speciaExpensesInfo02.jsp";//详细页 特殊费用
	private String update01Url = "/jsp/claim/specialExpenses/speciaExpensesUpdate01.jsp";//修改页 市场工单
	private String update02Url = "/jsp/claim/specialExpenses/speciaExpensesUpdate02.jsp";//修改页 特殊费用
	private String auditUrl = "/jsp/claim/specialExpenses/speciaExpensesAudit.jsp";//特殊费用审核查询页面
	private String audit01Url = "/jsp/claim/specialExpenses/speciaExpensesAudit01.jsp";//市场工单审核详细
	private String audit02Url = "/jsp/claim/specialExpenses/speciaExpensesAudit02.jsp";//特殊费用审核详细
	private String auditByOne01Url = "/jsp/claim/specialExpenses/speciaExpensesAuditByOne01.jsp";//市场工单审核详细
	private String auditByOne02Url = "/jsp/claim/specialExpenses/speciaExpensesAuditByOne02.jsp";//特殊费用审核详细
	private String areaAuditUrl = "/jsp/claim/specialExpenses/areaAuditSpeciaExpenses.jsp";//大区审核页面
	private String areaAudit02Url = "/jsp/claim/specialExpenses/areaAuditSpeciaInfo.jsp";//大区审核详细页
	private String queryDealerUrl = "/jsp/claim/specialExpenses/queryDealerSpecia.jsp";//经销商查询页面
	private String queryUrl = "/jsp/claim/specialExpenses/queryOemSpecia.jsp";//车厂查询页面
	private String showClaim = "/jsp/claim/specialExpenses/showClaim.jsp";//特殊外出费用详细页
	private String claimInitUrl = "/jsp/claim/specialExpenses/claimList.jsp";//关联索赔单详细页
	private String roInitUrl = "/jsp/claim/specialExpenses/roList.jsp";//关联工单详细页
	private String print01Url = "/jsp/claim/specialExpenses/print01.jsp";//市场工单打印页
	private String print02Url = "/jsp/claim/specialExpenses/print02.jsp";//特殊外出费用打印页
	private String queryActivity = "/jsp/claim/specialExpenses/queryActivity.jsp";//服务活动选择跳转页面
	private String queryRo = "/jsp/claim/specialExpenses/queryRoClaim.jsp" ;//工单索赔单选择跳转页面
	private String cruiseInit = "/jsp/claim/specialExpenses/queryCruise.jsp" ; // 航行路线选择页面初始化//
	private String auditUrlForword = "/jsp/claim/specialExpenses/speciaExpensesAuditForWord.jsp";//特殊费用审核查询页面
	private String auditUrlForword2 = "/jsp/claim/specialExpenses/speciaExpensesAuditForWord2.jsp";//特殊费用审核查询页面
	private String reauditUrl = "/jsp/claim/specialExpenses/speciaExpensesReAudit.jsp" ;//特殊费用重新审核主查询页面
	private String reauditDo_01 = "/jsp/claim/specialExpenses/speciaExpensesReAudit01.jsp" ;//特殊费用重新审核实现页面
	private String reauditDo_02 = "/jsp/claim/specialExpenses/speciaExpensesReAudit02.jsp" ;//特殊外出费用重新审核实现页面
	/*
	 * 特殊费用提报
	 */
	public void dealerSpProposeFor(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			act.setForword(initUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void querySpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerId(logonUser.getDealerId());
			bean.setCompanyId(logonUser.getOemCompanyId());
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.querySpeciaExpenses(bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 经销商查询
	 */
	public void queryDealerSpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerId(logonUser.getDealerId());
			bean.setCompanyId(logonUser.getOemCompanyId());
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.queryDealerSpeciaExpenses(bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 新增费用
	 */
	public void addSpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeType = request.getParamValue("feeType");
			String dealerId = logonUser.getDealerId();
			Map<String, Object> map = dao.getDealerInfo(dealerId);
			//查询tc_code 8008 区分轿微车
			TcCodePO code = new TcCodePO() ;
			code.setType("8008") ;
			List list = dao.select(code) ;
			if(list.size()>0)
				code = (TcCodePO)list.get(0);
			act.setOutData("code", code) ;
			act.setOutData("map", map);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(add01Url);
			}else{
				act.setForword(add02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"新增费用");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 新增市场工单费用
	 */
	public void addSpeciaExpensesDO(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String yieldly = CommonUtils.checkNull(request.getParamValue("yieldly"));//产地
			String declareSum = CommonUtils.checkNull(request.getParamValue("declareSum"));//申报金额
			String linkman = CommonUtils.checkNull(request.getParamValue("linkman"));   //联系人
			String tel = CommonUtils.checkNull(request.getParamValue("tel"));		    //联系电话
			String feeType = CommonUtils.checkNull(request.getParamValue("feeType"));//费用类型
			String vin = CommonUtils.checkNull(request.getParamValue("vin"));
			String model = CommonUtils.checkNull(request.getParamValue("model"));
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String feeFlag = request.getParamValue("feeFlag");
			String feeType1 = CommonUtils.checkNull(request.getParamValue("feeType1"));
			String activity_id = CommonUtils.checkNull(request.getParamValue("activity_id"));
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			po.setId(Long.parseLong(SequenceManager.getSequence("")));
			po.setFeeNo(SequenceManager.getSequence("GDFY"));
			po.setDealerId(Long.parseLong(logonUser.getDealerId()));
			po.setYield(Integer.parseInt(yieldly));
			po.setDeclareSum(Double.parseDouble(declareSum));
			po.setDeclareSum1(Double.parseDouble(declareSum));
			po.setLinkman(linkman);
			po.setLinkmanTel(tel);
			po.setFeeChannel(Integer.parseInt(feeType1));
			if(Constant.FEE_TYPE1_02.toString().equals(feeType1)){
				po.setActivityId(Long.parseLong(activity_id));
			}
			po.setVin(vin);
			po.setCompanyId(Long.parseLong(logonUser.getOemCompanyId()));
			po.setVModel(model);
			po.setFeeType(Integer.parseInt(feeType));
			Date date = new Date();
			if(feeFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_01));//未提报
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));//已提报
				po.setMakeDate(date);
				
				TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
				tp.setId(Long.parseLong(SequenceManager.getSequence("")));
				tp.setFeeId(po.getId());
				tp.setAuditingDate(date);
				tp.setAuditingPerson(logonUser.getName());
				tp.setPresonDept(logonUser.getOrgId());
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));
				tp.setCreateBy(logonUser.getUserId());
				tp.setCreateDate(date);
				dao.insert(tp);
			}
			po.setApplyContent(remark);
			po.setCreateBy(logonUser.getUserId());
			po.setCreateDate(date);
			dao.insert(po);//插入TT_AS_WR_SPEFEE 工单费用

			String ywzj = String.valueOf(po.getId());//插入并获得主键id,插入附件时用
			//附近功能：
			String[] fjids = request.getParamValues("fjid");
			FileUploadManager.fileUploadByBusiness(ywzj, fjids, logonUser);	
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 特殊外出费用 添加
	 */
	public void addSpeciaExpensesDO02(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String yieldly = CommonUtils.checkNull(request.getParamValue("yieldly"));//产地
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));//开始时间
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));//结束时间
			String purposeAddress = CommonUtils.checkNull(request.getParamValue("purposeAddress"));//目的地
			String personNum = CommonUtils.checkNull(request.getParamValue("personNum"));//人员数量
			String personName = CommonUtils.checkNull(request.getParamValue("personName"));//人员姓名
			String SINGLE_MILEAGE = CommonUtils.checkNull(request.getParamValue("SINGLE_MILEAGE"));//单程里程
			String PASS_FEE = request.getParamValue("PASS_FEE")==null?"0":request.getParamValue("PASS_FEE");//过路过桥
			String TRAFFIC_FEE = request.getParamValue("TRAFFIC_FEE")==null?"0":request.getParamValue("TRAFFIC_FEE");//交通补助
			String QUARTER_FEE = request.getParamValue("QUARTER_FEE")==null?"0":request.getParamValue("QUARTER_FEE");//住宿费
			String EAT_FEE = request.getParamValue("EAT_FEE")==null?"0":request.getParamValue("EAT_FEE");//餐补
			String PERSON_SUBSIDE = request.getParamValue("PERSON_SUBSIDE")==null?"0":request.getParamValue("PERSON_SUBSIDE");//人员补助
			String declareSum = request.getParamValue("totalCount")==null?"0":request.getParamValue("totalCount");//总费用
			String FEE_CHANNEL = CommonUtils.checkNull(request.getParamValue("FEE_CHANNEL"));//费用渠道
			String feeType = Constant.FEE_TYPE_02;//费用类型
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));//备注
			String feeFlag = request.getParamValue("feeFlag");
			String outDays = request.getParamValue("out_days");
			String freeCharge = request.getParamValue("vin_num");//三包内用户数
			//如果是巡航服务则添加另两个数据
			if(Constant.FEE_CHANNEL_03.equals(FEE_CHANNEL)){
				purposeAddress = request.getParamValue("address");
				//SINGLE_MILEAGE = request.getParamValue("mileage2");
			}
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			po.setId(Long.parseLong(SequenceManager.getSequence("")));
			po.setFeeNo(SequenceManager.getSequence("TSCW"));
			po.setDealerId(Long.parseLong(logonUser.getDealerId()));
			po.setYield(Integer.parseInt(yieldly));
			po.setDeclareSum(Double.parseDouble(declareSum));
			po.setDeclareSum1(Double.parseDouble(declareSum));
			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
			po.setStartDate(formatter.parse(beginTime));
			po.setEndDate(formatter.parse(endTime));
			po.setPurposeAddress(purposeAddress);
			po.setPersonName(personName);
			po.setPersonNum(Long.parseLong(personNum));
			po.setSingleMileage(Double.parseDouble(SINGLE_MILEAGE));
			po.setPassFee(StringUtil.isNull(PASS_FEE)?0:Double.parseDouble(PASS_FEE));
			po.setPassFee1(StringUtil.isNull(PASS_FEE)?0:Double.parseDouble(PASS_FEE));
			po.setQuarterFee(StringUtil.isNull(QUARTER_FEE)?0:Double.parseDouble(QUARTER_FEE));
			po.setQuarterFee1(StringUtil.isNull(QUARTER_FEE)?0:Double.parseDouble(QUARTER_FEE));
			po.setTrafficFee(StringUtil.isNull(TRAFFIC_FEE)?0:Double.parseDouble(TRAFFIC_FEE));
			po.setTrafficFee1(StringUtil.isNull(TRAFFIC_FEE)?0:Double.parseDouble(TRAFFIC_FEE));
			po.setEatFee(StringUtil.isNull(EAT_FEE)?0:Double.parseDouble(EAT_FEE));
			po.setEatFee1(StringUtil.isNull(EAT_FEE)?0:Double.parseDouble(EAT_FEE));
			po.setPersonSubside(StringUtil.isNull(PERSON_SUBSIDE)?0:Double.parseDouble(PERSON_SUBSIDE));
			po.setPersonSubside1(StringUtil.isNull(PERSON_SUBSIDE)?0:Double.parseDouble(PERSON_SUBSIDE));
			po.setFeeChannel(Integer.parseInt(FEE_CHANNEL));
			po.setFeeType(Integer.parseInt(feeType));
			po.setCompanyId(Long.parseLong(logonUser.getOemCompanyId()));
			po.setOutDays(Integer.parseInt(outDays));
			//上门服务的时候，记录一下此次服务的三包内用户数
			if(Constant.FEE_CHANNEL_02.equals(FEE_CHANNEL)){
				if(StringUtil.notNull(freeCharge))
					po.setFreeCharge(Integer.parseInt(freeCharge));
			}
			Date date = new Date();
			if(feeFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_01));//未提报
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));//已提报
				po.setMakeDate(date);
				
				TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
				tp.setId(Long.parseLong(SequenceManager.getSequence("")));
				tp.setFeeId(po.getId());
				tp.setAuditingDate(date);
				tp.setAuditingPerson(logonUser.getName());
				tp.setPresonDept(logonUser.getOrgId());
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));
				tp.setCreateBy(logonUser.getUserId());
				tp.setCreateDate(date);
				dao.insert(tp);
			}
			po.setApplyContent(remark);
			po.setCreateBy(logonUser.getUserId());
			po.setCreateDate(date);
			dao.insert(po);//插入TT_AS_WR_SPEFEE 工单费用

			String ywzj = String.valueOf(po.getId());//插入并获得主键id,插入附件时用
			//附近功能：
			String[] fjids = request.getParamValues("fjid");
			FileUploadManager.fileUploadByBusiness(ywzj, fjids, logonUser);	
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void speciaExpensesInfo(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String feeType = request.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("claim", claim);
			act.setOutData("fileList", fileList);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(info01Url);
			}else{
				act.setForword(info02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊外出费用详细");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 修改工单
	 */
	public void updateSpecialExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String feeType = request.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			//查询tc_code 8008 区分轿微车
			TcCodePO code = new TcCodePO() ;
			code.setType("8008") ;
			List list = dao.select(code) ;
			if(list.size()>0)
				code = (TcCodePO)list.get(0);
			act.setOutData("code", code) ;
			act.setOutData("map", map);
			act.setOutData("fileList", fileList);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(update01Url);
			}else{
				List<Map<String, Object>> claim = dao.getFeeRoList(id);
				act.setOutData("claim", claim);
				act.setOutData("nums",claim.size());
				act.setForword(update02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"修改");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 修改工单信息
	 */
	public void updateSpeciaExpensesDO(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String yieldly = CommonUtils.checkNull(request.getParamValue("yieldly"));//产地
			String declareSum = CommonUtils.checkNull(request.getParamValue("declareSum"));//申报金额
			String linkman = CommonUtils.checkNull(request.getParamValue("linkman"));   //联系人
			String tel = CommonUtils.checkNull(request.getParamValue("tel"));		    //联系电话
			String feeType = CommonUtils.checkNull(request.getParamValue("feeType"));//费用类型
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String vin = CommonUtils.checkNull(request.getParamValue("vin"));
			String vModel = CommonUtils.checkNull(request.getParamValue("model"));
			String feeFlag = request.getParamValue("feeFlag");
			String id = request.getParamValue("id");
			String feeType1 = CommonUtils.checkNull(request.getParamValue("feeType1"));
			String activity_id = CommonUtils.checkNull(request.getParamValue("activity_id"));
			
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			po.setYield(Integer.parseInt(yieldly));
			po.setDeclareSum(Double.parseDouble(declareSum));
			po.setDeclareSum1(Double.parseDouble(declareSum));
			po.setLinkman(linkman);
			po.setLinkmanTel(tel);
			po.setFeeType(Integer.parseInt(Constant.FEE_TYPE_01));
			po.setFeeChannel(Integer.parseInt(feeType1));
			if(Constant.FEE_TYPE1_02.toString().equals(feeType1)){
				po.setActivityId(Long.parseLong(activity_id));
			}
			po.setVin(vin);
			po.setVModel(vModel);
			Date date = new Date();
			if(feeFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_01));//未提报
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));//已提报
				po.setMakeDate(date);
				TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
				tp.setId(Long.parseLong(SequenceManager.getSequence("")));
				tp.setFeeId(Long.parseLong(id));
				tp.setAuditingDate(date);
				tp.setAuditingPerson(logonUser.getName());
				tp.setPresonDept(logonUser.getOrgId());
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));
				tp.setCreateBy(logonUser.getUserId());
				tp.setCreateDate(date);
				dao.insert(tp);
			}
			po.setApplyContent(remark);
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			//附近功能：
			String ywzj = id;
			String[] fjids = request.getParamValues("fjid");
			FileUploadManager.delAllFilesUploadByBusiness(ywzj,fjids);//删除附件
			FileUploadManager.fileUploadByBusiness(ywzj, fjids, logonUser);	//新添加附件
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	/*
	 * 修改特殊费用
	 */
	public void updateSpeciaExpensesDO02(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String yieldly = CommonUtils.checkNull(request.getParamValue("yieldly"));//产地
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));//开始时间
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));//结束时间
			String purposeAddress = CommonUtils.checkNull(request.getParamValue("purposeAddress"));//目的地
			String personNum = CommonUtils.checkNull(request.getParamValue("personNum"));//人员数量
			String personName = CommonUtils.checkNull(request.getParamValue("personName"));//人员姓名
			String SINGLE_MILEAGE = CommonUtils.checkNull(request.getParamValue("SINGLE_MILEAGE"));//单程里程
			String PASS_FEE = CommonUtils.checkNull(request.getParamValue("PASS_FEE"));//过路过桥
			String TRAFFIC_FEE = CommonUtils.checkNull(request.getParamValue("TRAFFIC_FEE"));//交通补助
			String QUARTER_FEE = CommonUtils.checkNull(request.getParamValue("QUARTER_FEE"));//住宿费
			String EAT_FEE = CommonUtils.checkNull(request.getParamValue("EAT_FEE"));//餐补
			String PERSON_SUBSIDE = CommonUtils.checkNull(request.getParamValue("PERSON_SUBSIDE"));//人员补助
			String declareSum = CommonUtils.checkNull(request.getParamValue("totalCount"));//总费用
			String FEE_CHANNEL = CommonUtils.checkNull(request.getParamValue("FEE_CHANNEL"));//费用渠道
			String feeType = Constant.FEE_TYPE_02;//费用类型
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));//备注
			String feeFlag = request.getParamValue("feeFlag");
			String id = request.getParamValue("id");
			String freeCharge = request.getParamValue("vin_num");
			//如果是巡航服务则添加另两个数据
			if(Constant.FEE_CHANNEL_03.equals(FEE_CHANNEL)){
				purposeAddress = request.getParamValue("address");
				//SINGLE_MILEAGE = request.getParamValue("mileage2");
			}
			
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			po.setYield(Integer.parseInt(yieldly));
			po.setDeclareSum(Double.parseDouble(declareSum));
			po.setDeclareSum1(Double.parseDouble(declareSum));
			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
			po.setStartDate(formatter.parse(beginTime));
			po.setEndDate(formatter.parse(endTime));
			po.setPurposeAddress(purposeAddress);
			po.setPersonName(personName);
			po.setPersonNum(Long.parseLong(personNum));
			po.setSingleMileage(Double.parseDouble(SINGLE_MILEAGE));
			po.setPassFee(StringUtil.isNull(PASS_FEE)?0:Double.parseDouble(PASS_FEE));
			po.setQuarterFee(StringUtil.isNull(QUARTER_FEE)?0:Double.parseDouble(QUARTER_FEE));
			po.setTrafficFee(StringUtil.isNull(TRAFFIC_FEE)?0:Double.parseDouble(TRAFFIC_FEE));
			po.setEatFee(StringUtil.isNull(EAT_FEE)?0:Double.parseDouble(EAT_FEE));
			po.setPersonSubside(StringUtil.isNull(PERSON_SUBSIDE)?0:Double.parseDouble(PERSON_SUBSIDE));
			po.setPassFee1(StringUtil.isNull(PASS_FEE)?0:Double.parseDouble(PASS_FEE));
			po.setQuarterFee1(StringUtil.isNull(QUARTER_FEE)?0:Double.parseDouble(QUARTER_FEE));
			po.setTrafficFee1(StringUtil.isNull(TRAFFIC_FEE)?0:Double.parseDouble(TRAFFIC_FEE));
			po.setEatFee1(StringUtil.isNull(EAT_FEE)?0:Double.parseDouble(EAT_FEE));
			po.setPersonSubside1(StringUtil.isNull(PERSON_SUBSIDE)?0:Double.parseDouble(PERSON_SUBSIDE));
			po.setFeeChannel(Integer.parseInt(FEE_CHANNEL));
			//上门服务的时候，记录一下此次服务的三包内用户数
			if(Constant.FEE_CHANNEL_02.equals(FEE_CHANNEL)){
				if(StringUtil.notNull(freeCharge))
					po.setFreeCharge(Integer.parseInt(freeCharge));
			}
			po.setFeeType(Integer.parseInt(feeType));
			Date date = new Date();
			if(feeFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_01));//未提报
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));//已提报
				po.setMakeDate(date);
				TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
				tp.setId(Long.parseLong(SequenceManager.getSequence("")));
				tp.setFeeId(Long.parseLong(id));
				tp.setAuditingDate(date);
				tp.setAuditingPerson(logonUser.getName());
				tp.setPresonDept(logonUser.getOrgId());
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_02));
				tp.setCreateBy(logonUser.getUserId());
				tp.setCreateDate(date);
				dao.insert(tp);
			}
			po.setApplyContent(remark);
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			//附近功能：
			String ywzj = id;
			String[] fjids = request.getParamValues("fjid");
			FileUploadManager.delAllFilesUploadByBusiness(ywzj,fjids);//删除附件
			FileUploadManager.fileUploadByBusiness(ywzj, fjids, logonUser);	//新添加附件
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 结算室审核
	 */
	public void specialExaminesFor(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			//取得该用户拥有的产地权限
			String yieldly = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			
			act.setOutData("yieldly", yieldly);
			act.setForword(auditUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"结算室审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 审核查询页面
	 */
	public void auditQuerySpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.auditQuerySpeciaExpenses(bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	/****
	 * 
	 * 结算单审核页面跳转到特殊费用审核页面
	 * 
	 * 
	 */
	
	public void forwordAuditing(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			String balanceId = request.getParamValue("orderId");
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			bean.setBalanceId(balanceId);
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.auditQuerySpeciaExpenses3(bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("orderId", balanceId);
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	
	public void forwordAuditingMain(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String balanceId = request.getParamValue("orderId");
			System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&:"+balanceId);

			//分页方法 end
			act.setOutData("orderId", balanceId);    //向前台传的list 名称是固定的不可改必须用 ps
			act.setForword(auditUrlForword2);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	/*
	 * 车厂端查询页面
	 */
	public void queryOemSpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			/***add xiongchuan 2011-03-14 增加费用渠道查询*****/
			String feeChannel=CommonUtils.checkNull(request.getParamValue("FEE_CHANNEL"));
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			String dutyType = logonUser.getDutyType();
			String orgId = String.valueOf(logonUser.getOrgId());
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setOrgId(orgId);
			bean.setDutyType(dutyType);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			bean.setFeeChannel(feeChannel);
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.queryOmeSpeciaExpenses(bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 大区审核查询页面
	 */
	public void areaAuditQuerySpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("YIELDLY");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String orgId = String.valueOf(logonUser.getOrgId());
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setOrgId(orgId);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			PageResult<Map<String, Object>> ps = dao.areaAuditQuerySpeciaExpenses(logonUser.getUserId(),bean,curPage,Constant.PAGE_SIZE);
			//分页方法 end
			act.setOutData("ps", ps);     //向前台传的list 名称是固定的不可改必须用 ps
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 审核详细页
	 */
	public void auditSpecialExpensesInfo(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String feeType = request.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("fileList", fileList);
			act.setOutData("claim", claim);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(audit01Url);
			}else{
				act.setForword(audit02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 逐条审核详细页
	 */
	public void auditSpecialExpensesInfoByOne(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			//审核条数记录
			String count = request.getParamValue("count")==null?"0":request.getParamValue("count");
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				act.setOutData("dealerCode", dealerCode);
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			//分页方法 begin
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页	
			List<Map<String, Object>> ps = dao.auditQuerySpeciaExpensesByOne(bean);
			//分页方法 end
			if(ps!=null){
				if(ps.size()>Integer.valueOf(count)){
					Map<String, Object> specialMap = ps.get(Integer.valueOf(count));
					     //向前台传的list 名称是固定的不可改必须用 ps
					
					//查询第一条特殊费用单信息
					String id = specialMap.get("ID").toString();
		//			String feeTypeGet = specialMap.get("FEE_TYPE").toString();
					Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
					List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
					StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
					List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
					List<Map<String, Object>> claim = dao.getFeeRoList(id);
					act.setOutData("firstSpecial", specialMap);  //与单条审核区别
					act.setOutData("map", map);
					act.setOutData("list", list);
					act.setOutData("fileList", fileList);
					act.setOutData("claim", claim);
					
					//向下一条传查询条件
					
					act.setOutData("beginTime", beginTime);
					act.setOutData("endTime", endTime);
					act.setOutData("feeNo", feeNo);
					act.setOutData("yieldly", yieldly);
					act.setOutData("feeType", feeType);
					act.setOutData("count", count);
					if(specialMap.get("FEE_TYPE").toString().equals(Constant.FEE_TYPE_01)){
						act.setForword(auditByOne01Url);
					}else{
						act.setForword(auditByOne02Url);
					}
				}else{
					act.setForword(auditUrl);
				}
			}else{
				act.setForword(auditUrl);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 大区审核详细页
	 */
	public void areaAuditSpecialExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String feeType = request.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("fileList", fileList);
			act.setOutData("claim", claim);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(audit01Url);
			}else{
				act.setForword(areaAudit02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"大区审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 审核市场工单费用
	 */
	public void auditSpeciaExpenses01(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String auditFlag = request.getParamValue("auditFlag");
			String feeType = CommonUtils.checkNull(request.getParamValue("feeType"));
			String auditMoney = request.getParamValue("audit_money");//审核同意金额
			Date date = new Date();
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			if(auditFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));//已结算
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));//驳回
			}
			if(feeType.equals(Constant.FEE_TYPE_02)){
				String PASS_FEE = CommonUtils.checkNull(request.getParamValue("PASS_FEE"));//过路过桥
				String TRAFFIC_FEE = CommonUtils.checkNull(request.getParamValue("TRAFFIC_FEE"));//交通补助
				String QUARTER_FEE = CommonUtils.checkNull(request.getParamValue("QUARTER_FEE"));//住宿费
				String EAT_FEE = CommonUtils.checkNull(request.getParamValue("EAT_FEE"));//餐补
				String PERSON_SUBSIDE = CommonUtils.checkNull(request.getParamValue("PERSON_SUBSIDE"));//人员补助
				String declareSum = CommonUtils.checkNull(request.getParamValue("totalCount"));//总费用 
				po.setPassFee(Double.parseDouble(PASS_FEE));
				po.setTrafficFee(Double.parseDouble(TRAFFIC_FEE));
				po.setQuarterFee(Double.parseDouble(QUARTER_FEE));
				po.setEatFee(Double.parseDouble(EAT_FEE));
				po.setPersonSubside(Double.parseDouble(PERSON_SUBSIDE));
				po.setDeclareSum(Double.parseDouble(declareSum));
			}
			//审核同意金额
			if(StringUtil.notNull(auditMoney)){
				po.setDeclareSum(Double.parseDouble(auditMoney));
			}
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			po.setAuditingOpinion(remark);//审核意见
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
			tp.setId(Long.parseLong(SequenceManager.getSequence("")));
			tp.setFeeId(pp.getId());
			tp.setAuditingDate(date);
			tp.setAuditingPerson(logonUser.getName());
			tp.setPresonDept(logonUser.getOrgId());
			if(auditFlag.equals("1")){//通过
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));
			}else{//驳回
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));
			}
			tp.setCreateBy(logonUser.getUserId());
			tp.setCreateDate(date);
			tp.setAuditingOpinion(remark);
			dao.insert(tp);
			
			String balanceId = request.getParamValue("balanceId");
			Integer count = dao.getCount(balanceId);
			TtAsWrClaimBalancePO ac = new TtAsWrClaimBalancePO();
			TtAsWrClaimBalancePO bc = new TtAsWrClaimBalancePO();
			ac.setId(Long.parseLong(balanceId));
			bc.setSpecFeeAuthCount(Long.parseLong(String.valueOf(count)));
			dao.update(ac, bc);
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 重新审核
	 */
	public void reauditSpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String auditFlag = request.getParamValue("auditFlag");
			String feeType = CommonUtils.checkNull(request.getParamValue("feeType"));
			String auditMoney = request.getParamValue("audit_money");//审核同意金额
			Date date = new Date();
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			if(auditFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));//已结算
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));//驳回
			}
			if(feeType.equals(Constant.FEE_TYPE_02)){
				String PASS_FEE = CommonUtils.checkNull(request.getParamValue("PASS_FEE"));//过路过桥
				String TRAFFIC_FEE = CommonUtils.checkNull(request.getParamValue("TRAFFIC_FEE"));//交通补助
				String QUARTER_FEE = CommonUtils.checkNull(request.getParamValue("QUARTER_FEE"));//住宿费
				String EAT_FEE = CommonUtils.checkNull(request.getParamValue("EAT_FEE"));//餐补
				String PERSON_SUBSIDE = CommonUtils.checkNull(request.getParamValue("PERSON_SUBSIDE"));//人员补助
				String declareSum = CommonUtils.checkNull(request.getParamValue("totalCount"));//总费用 
				po.setPassFee(Double.parseDouble(PASS_FEE));
				po.setTrafficFee(Double.parseDouble(TRAFFIC_FEE));
				po.setQuarterFee(Double.parseDouble(QUARTER_FEE));
				po.setEatFee(Double.parseDouble(EAT_FEE));
				po.setPersonSubside(Double.parseDouble(PERSON_SUBSIDE));
				po.setDeclareSum(Double.parseDouble(declareSum));
			}
			//审核同意金额
			if(StringUtil.notNull(auditMoney)){
				po.setDeclareSum(Double.parseDouble(auditMoney));
			}
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			po.setAuditingOpinion(remark);//审核意见
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
			tp.setId(Long.parseLong(SequenceManager.getSequence("")));
			tp.setFeeId(pp.getId());
			tp.setAuditingDate(date);
			tp.setAuditingPerson(logonUser.getName());
			tp.setPresonDept(logonUser.getOrgId());
			if(auditFlag.equals("1")){//通过
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));
			}else{//驳回
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));
			}
			tp.setCreateBy(logonUser.getUserId());
			tp.setCreateDate(date);
			tp.setAuditingOpinion(remark);
			dao.insert(tp);
			
			String balanceId = request.getParamValue("balanceId");
			Integer count = dao.getCount(balanceId);
			TtAsWrClaimBalancePO ac = new TtAsWrClaimBalancePO();
			TtAsWrClaimBalancePO bc = new TtAsWrClaimBalancePO();
			ac.setId(Long.parseLong(balanceId));
			bc.setSpecFeeAuthCount(Long.parseLong(String.valueOf(count)));
			dao.update(ac, bc);
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 审核市场工单费用批量审核
	 */
	public void auditSpeciaExpensesBatch01(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String specialId[] = request.getParamValues("specialId");
//			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
//			String auditFlag = request.getParamValue("auditFlag");
			String[] feeType = request.getParamValues("feeTypeT");
			
			String[] mySpecialId = request.getParamValues("mySpecialId");
			String[] passFee = request.getParamValues("PASS_FEE");
			String[] trafficFee = request.getParamValues("TRAFFIC_FEE");
			String[] quarterFee = request.getParamValues("QUARTER_FEE");
			String[] eatFee = request.getParamValues("EAT_FEE");
			String[] personSubside = request.getParamValues("PERSON_SUBSIDE");
			String[] claimBalanceId = request.getParamValues("CLAIMBALANCE_ID");
			
			String selFeeType = "";
			String selPassFee = "";
			String selTrafficFee = "";
			String selQuarterFee = "";
			String selEatFee = "";
			String selPersonSubside = "";
			String selClaimBalanceId = "";
			for(int i = 0; i < specialId.length; i++){
				for(int j = 0 ; j < mySpecialId.length; j++){
					if(mySpecialId[j].equals(specialId[i])){
						selFeeType = feeType[j];
						selPassFee = passFee[j];
						selTrafficFee = trafficFee[j];
						selQuarterFee = quarterFee[j];
						selEatFee = eatFee[j];
						selPersonSubside = personSubside[j];
						selClaimBalanceId = claimBalanceId[j];
						
						Date date = new Date();
						TtAsWrSpefeePO po = new TtAsWrSpefeePO();
						TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
//						if(auditFlag.equals("1")){
							po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));//已结算
//						}else{
//							po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));//驳回
//						}
						if(selFeeType.equals(Constant.FEE_TYPE_02)){
							Double PASS_FEE = Double.valueOf(selPassFee);//过路过桥
							Double TRAFFIC_FEE = Double.valueOf(selTrafficFee);//交通补助
							Double QUARTER_FEE = Double.valueOf(selQuarterFee);//住宿费
							Double EAT_FEE = Double.valueOf(selEatFee);//餐补
							Double PERSON_SUBSIDE = Double.valueOf(selPersonSubside);//人员补助
							Double declareSum = PASS_FEE+TRAFFIC_FEE+QUARTER_FEE+EAT_FEE+PERSON_SUBSIDE;//总费用 
							po.setPassFee(PASS_FEE);
							po.setTrafficFee(TRAFFIC_FEE);
							po.setQuarterFee(QUARTER_FEE);
							po.setEatFee(EAT_FEE);
							po.setPersonSubside(PERSON_SUBSIDE);
							po.setDeclareSum(declareSum);
						}
						
						po.setUpdateBy(logonUser.getUserId());
						po.setUpdateDate(date);
						po.setAuditingOpinion("");//审核意见
						pp.setId(Long.parseLong(specialId[i]));
						dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

						TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
						tp.setId(Long.parseLong(SequenceManager.getSequence("")));
						tp.setFeeId(pp.getId());
						tp.setAuditingDate(date);
						tp.setAuditingPerson(logonUser.getName());
						tp.setPresonDept(logonUser.getOrgId());
//						if(auditFlag.equals("1")){//通过
							tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));
//						}else{//驳回
//							tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));
//						}
						tp.setCreateBy(logonUser.getUserId());
						tp.setCreateDate(date);
						tp.setAuditingOpinion("");
						dao.insert(tp);
						
//						String balanceId = request.getParamValue("balanceId");
						Integer count = dao.getCount(selClaimBalanceId);
						TtAsWrClaimBalancePO ac = new TtAsWrClaimBalancePO();
						TtAsWrClaimBalancePO bc = new TtAsWrClaimBalancePO();
						ac.setId(Long.parseLong(selClaimBalanceId));
						bc.setSpecFeeAuthCount(Long.parseLong(String.valueOf(count)));
						dao.update(ac, bc);
					}
					
				}
				
			}
			
			
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void areaAuditSpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String auditFlag = request.getParamValue("auditFlag");
			Date date = new Date();
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			if(auditFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_04));//已结算
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_03));//驳回
				String balanceId = request.getParamValue("balanceId");
				Integer count = dao.getCount(balanceId);
				TtAsWrClaimBalancePO ac = new TtAsWrClaimBalancePO();
				TtAsWrClaimBalancePO bc = new TtAsWrClaimBalancePO();
				ac.setId(Long.parseLong(id));
				bc.setSpecFeeAuthCount(Long.parseLong(String.valueOf(count)));
				dao.update(ac, bc);
			}
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			po.setAuditingOpinion(remark);//审核意见
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
			tp.setId(Long.parseLong(SequenceManager.getSequence("")));
			tp.setFeeId(pp.getId());
			tp.setAuditingDate(date);
			tp.setAuditingPerson(logonUser.getName());
			tp.setPresonDept(logonUser.getOrgId());
			if(auditFlag.equals("1")){//通过
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_04));
			}else{//驳回
				tp.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_03));
			}
			tp.setCreateBy(logonUser.getUserId());
			tp.setCreateDate(date);
			tp.setAuditingOpinion(remark);
			dao.insert(tp);
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void sumDayCount(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String val1 = CommonUtils.checkNull(request.getParamValue("day1"));
			String val2 = CommonUtils.checkNull(request.getParamValue("day2"));
			if(val1.equals("")||val2.equals("")){
				act.setOutData("dayCount", 0);
			}else{
				int dayCount = Utility.compareDate(val1, val2, 0);
				act.setOutData("dayCount", dayCount);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 大区审核页面查询初始化
	 */
	public void areaSpecialExaminesFor(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			//取得该用户拥有的产地权限
			String yieldly = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			
			act.setOutData("yieldly", yieldly);
			act.setForword(areaAuditUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"结算室审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 车厂查询
	 */
	public void specialSerchFor(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			String dutyType = logonUser.getDutyType();
			//取得该用户拥有的产地权限
			String yieldly = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			
			act.setOutData("yieldly", yieldly);
			act.setOutData("dutyType", dutyType);
			act.setForword(queryUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"结算室审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 经销商查询
	 */
	public void dealerSpSearchFor(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			act.setForword(queryDealerUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"结算室审核");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 特殊(外出)费用 打印
	 */
	public void windowPrintList(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String feeType = request.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("claim", claim);
			act.setOutData("fileList", fileList);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(print01Url);
			}else{
				act.setForword(print02Url);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊外出费用打印");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 与索赔单关联
	 */
	public void showFeeType2Map(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("claim", claim);
			act.setOutData("fileList", fileList);
			act.setForword(showClaim);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊外出费用详细");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void addClaim(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String channel = request.getParamValue("channel");
			String yieldly = request.getParamValue("yieldly");
			act.setOutData("id", id);
			act.setOutData("channel",channel);
			act.setOutData("yieldly",yieldly);
			act.setForword(claimInitUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void addRO(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String channel = request.getParamValue("channel");
			String yieldly = request.getParamValue("yieldly");
			act.setOutData("id", id);
			act.setOutData("channel",channel);
			act.setOutData("yieldly",yieldly);
			act.setForword(roInitUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void applicationQuery() {
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean) act.getSession().get(
				Constant.LOGON_USER);
		Long companyId = GetOemcompanyId.getOemCompanyId(logonUser); // 公司ID
		String dealerId = logonUser.getDealerId();
		Map<String, String> map = new HashMap<String, String>();
		try {
			RequestWrapper request = act.getRequest();
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页
			String claimNo = request.getParamValue("CLAIM_NO");
			String vin = request.getParamValue("VIN");
			String roStartdate = request.getParamValue("RO_STARTDATE");
			String roEnddate = request.getParamValue("RO_ENDDATE");
			String channel = request.getParamValue("channel");
			String yieldly = request.getParamValue("yieldly");
			map.put("dealerId", dealerId);
			map.put("claimNo", claimNo);
			map.put("vin", vin);
			map.put("roStartdate", roStartdate);
			map.put("roEnddate", roEnddate);
			map.put("status", String.valueOf(Constant.CLAIM_APPLY_ORD_TYPE_04));
			map.put("oemCompanyId", companyId.toString());
			map.put("channel", channel);
			map.put("yieldly", yieldly);

			PageResult<Map<String, Object>> ps = dao.queryApplication(map, 10, curPage);
			act.setOutData("ps", ps);
		} catch (Exception e) {
			BizException e1 = new BizException(act, e,ErrorCodeConstant.QUERY_FAILURE_CODE, "索赔单维护");
			logger.error(logonUser, e1);
			act.setException(e1);
		}
	}
	
	public void roQuery() {
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean) act.getSession().get(
				Constant.LOGON_USER);
		Long companyId = GetOemcompanyId.getOemCompanyId(logonUser); // 公司ID
		String dealerId = logonUser.getDealerId();
		Map<String, String> map = new HashMap<String, String>();
		try {
			RequestWrapper request = act.getRequest();
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage"))
					: 1; // 处理当前页
			String roNo = request.getParamValue("RO_NO");
			String vin = request.getParamValue("VIN");
			String roStartdate = request.getParamValue("RO_STARTDATE");
			String roEnddate = request.getParamValue("RO_ENDDATE");
			String channel = request.getParamValue("channel");
			String yieldly = request.getParamValue("yieldly");
			map.put("dealerId", dealerId);
			map.put("roNo", roNo);
			map.put("vin", vin);
			map.put("roStartdate", roStartdate);
			map.put("roEnddate", roEnddate);
			map.put("oemCompanyId", companyId.toString());
			map.put("channel", channel);
			map.put("yieldly", yieldly);

			PageResult<Map<String, Object>> ps = dao.queryRO(map, 10, curPage);
			act.setOutData("ps", ps);
		} catch (Exception e) {
			BizException e1 = new BizException(act, e,ErrorCodeConstant.QUERY_FAILURE_CODE, "索赔单维护");
			logger.error(logonUser, e1);
			act.setException(e1);
		}
	}
	
	public void addAppaction(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String[] ids = request.getParamValues("ids");
			if(ids!=null&&!ids.equals("")){
				String claimId = "";
				for(int i=0;i<ids.length;i++){
					if(claimId.equals("")){
						claimId = ids[i];
					}else{
						claimId = claimId + "," + ids[i];
					}
				}
				List<Map<String, Object>> list = dao.getClaimList(claimId);
				SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
				if(list!=null&&list.size()>0){
					for(int i=0;i<list.size();i++){
						Map<String, Object> map = list.get(i);
						TtAsWrSpefeeClaimPO po = new TtAsWrSpefeeClaimPO();
						po.setId(Long.parseLong(SequenceManager.getSequence("")));
						po.setFeeId(Long.parseLong(id));
						po.setClaimId(Long.parseLong(String.valueOf(map.get("CLAIM_ID"))));
						po.setClaimNo(String.valueOf(map.get("CLAIM_NO")));
						po.setSeries(String.valueOf(map.get("SERIES_CODE")));
						po.setModel(String.valueOf(map.get("MODEL_CODE")));
						po.setVin(String.valueOf(map.get("VIN")));
						po.setEngineNo(String.valueOf(map.get("ENGINE_NO")));
						//po.setProductDate(formatter.parse(String.valueOf(map.get("PRODUCT_DATE"))));
						po.setMileage(Double.parseDouble(String.valueOf(map.get("IN_MILEAGE"))));
						po.setCreateBy(logonUser.getUserId());
						po.setCreateDate(new Date());
						po.setClaimDate(po.getCreateDate());
						dao.insert(po);
					}
				}
			}
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	//将工单添加至特殊费用_索赔单表。此时没单独建特殊费用_工单表
	public void addRoToR(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String[] ids = request.getParamValues("ids");
			if(ids!=null&&!ids.equals("")){
				String roId = "";
				for(int i=0;i<ids.length;i++){
					if(roId.equals("")){
						roId = ids[i];
					}else{
						roId = roId + "," + ids[i];
					}
				}
				List<Map<String, Object>> list = dao.getRoList(roId);
				SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
				if(list!=null&&list.size()>0){
					for(int i=0;i<list.size();i++){
						Map<String, Object> map = list.get(i);
						TtAsWrSpefeeClaimPO po = new TtAsWrSpefeeClaimPO();
						po.setId(Long.parseLong(SequenceManager.getSequence("")));
						po.setFeeId(Long.parseLong(id));
						po.setClaimId(Long.parseLong(String.valueOf(map.get("RO_ID"))));
						po.setClaimNo(String.valueOf(map.get("RO_NO")));
						po.setSeries(String.valueOf(map.get("SERIES")));
						po.setModel(String.valueOf(map.get("MODEL")));
						po.setVin(String.valueOf(map.get("VIN")));
						po.setEngineNo(String.valueOf(map.get("ENGINE_NO")));
						if(StringUtil.notNull(CommonUtils.checkNull(map.get("PRODUCT_DATE"))))
							po.setProductDate(formatter.parse(String.valueOf(map.get("PRODUCT_DATE"))));
						po.setMileage(Double.parseDouble(String.valueOf(map.get("IN_MILEAGE"))));
						po.setCreateBy(logonUser.getUserId());
						SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
						po.setCreateDate(new Date());
						po.setClaimDate(fmt.parse(String.valueOf(map.get("CREATE_DATE"))));
						dao.insert(po);
					}
				}
			}
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void delCliam(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			TtAsWrSpefeeClaimPO po = new TtAsWrSpefeeClaimPO();
			po.setId(Long.parseLong(id));
			dao.delete(po);
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	public void getModel(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String vin = request.getParamValue("vin");
			Map<String, Object> map = dao.getModel(vin);
			act.setOutData("map", map);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
		
	}
	

	/*
	 * 活动工单选择服务活动初始化
	 */
	public void queryActivityInit(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String dealer_code = request.getParamValue("code");
			act.setOutData("code",dealer_code);
			act.setForword(queryActivity);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	public void queryActivity(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper req = act.getRequest();
			String dealer_code = req.getParamValue("code");
			String a_code = req.getParamValue("activity_code");
			String a_name = req.getParamValue("activity_name");
			StringBuffer con = new StringBuffer();
			if(StringUtil.notNull(a_code)){
				con.append("and a.activity_code like '%"+a_code+"%'\n");
			}
			if(StringUtil.notNull(a_name)){
				con.append("and a.activity_name like '%"+a_name+"%'\n");
			}
			Integer curPage = req.getParamValue("curPage") != null ? Integer
					.parseInt(req.getParamValue("curPage")): 1; // 处理当前页
			int pageSize = 10 ;
			PageResult<Map<String,Object>> ps=dao.getActivity(con.toString(),dealer_code, pageSize, curPage);
			act.setOutData("ps", ps);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	public void queryActivityName(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			TtAsActivityPO po = new TtAsActivityPO();
			po.setActivityId(Long.parseLong(id));
			List list = dao.select(po);
			String name = "" ;
			if(list.size()>0){
				name = ((TtAsActivityPO)list.get(0)).getActivityName() ;
			}
			act.setOutData("name", name);
			
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 工单的查询页面初始化
	 */
	public void queryRoInit(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			act.setForword(queryRo);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	
	/*
	 * 特殊费用申报金额限制的判断
	 */
	public void speOutFeeCheck(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try{
			RequestWrapper req = act.getRequest();
			String singleMile = req.getParamValue("SINGLE_MILEAGE");
			String channel = req.getParamValue("FEE_CHANNEL");
			String id = req.getParamValue("id");
			//上门服务类型查询维修工单数
			if(Constant.FEE_CHANNEL_02.equals(channel)){
				List list = dao.getVinNum(id);
				act.setOutData("freeCharge", list.size());
			}
			
			/*if(Constant.FEE_CHANNEL_03.equals(channel))
				singleMile = req.getParamValue("mileage2");*/
	
			TmChananelMileagePO po = new TmChananelMileagePO() ;
			po.setChananelType(Integer.parseInt(channel));
			po.setMileage(Long.parseLong(singleMile));
			List list = dao.select(po);
			boolean flag = false ; //验证是否有此记录 
			if(list.size()>0){
				po = (TmChananelMileagePO)list.get(0);
				act.setOutData("bridge",po.getBridgeFee() );
				act.setOutData("eat",po.getCateringFee() );
				act.setOutData("quarter",po.getExpensesFee() );
				act.setOutData("mileage",po.getMileage() );
				act.setOutData("outDay",po.getOutDays() );
				act.setOutData("person",po.getPersonFee());
				act.setOutData("train",po.getTrainFee());
			}else
				flag = true ;
			act.setOutData("flag", flag);
			act.setOutData("val", req.getParamValue("type"));
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	/*
	 * 航行路线选择页面初始化
	 */
	public void queryCruiseInit(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			act.setForword(cruiseInit);			
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"航行路线查询");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	public void queryCruise(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper req = act.getRequest();
			String cr_no = req.getParamValue("cr_no");
			StringBuffer sql = new StringBuffer();
			sql.append("  and c.dealer_id=").append(logonUser.getDealerId());
			if(StringUtil.notNull(cr_no)){
				sql.append("  and c.cr_no like '%").append(cr_no).append("%'\n");
			}
			sql.append("  and (c.status = 13631006 or");
			sql.append(" (c.status = 13631005 and c.suspend_date > sysdate - 3))\n");

			Integer curPage = req.getParamValue("curPage") != null ? Integer
					.parseInt(req.getParamValue("curPage")): 1; // 处理当前页
			int pageSize = 10 ;
			PageResult<Map<String,Object>> ps = dao.getCruise(sql.toString(), pageSize, curPage);
			act.setOutData("ps", ps);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"航行路线查询");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	public void getCurise(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper req = act.getRequest();
			String id = req.getParamValue("id");
			TtAsWrCruisePO po = new TtAsWrCruisePO();
			po.setId(Long.parseLong(id));
			List list = dao.select(po);
			if(list.size()>0){
				po = (TtAsWrCruisePO)list.get(0);
				act.setOutData("address", po.getCrWhither());
				act.setOutData("days", po.getCrDay());
				act.setOutData("mileage", po.getCrMileage());
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"航行路线查询");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	//特殊费用的删除
	public void delSpefee(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper req = act.getRequest();
			String id = req.getParamValue("id");
			String sql1 = "delete from tt_as_wr_spefee_claim where fee_id="+id ;
			dao.delete(sql1,null);
			String sql2 = "delete from tt_as_wr_spefee where id="+id ;
			dao.delete(sql2,null);
			dealerSpProposeFor();
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.DELETE_FAILURE_CODE,"特殊费用删除");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	//特殊费用重新审核
	public void reauditMainInit(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			String yieldly = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			act.setOutData("yieldly", yieldly);
			act.setForword(reauditUrl);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.DELETE_FAILURE_CODE,"特殊费用删除");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	//重新审核查询方法
	public void reauditQuerySpeciaExpenses(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String feeNo = request.getParamValue("feeNo");
			String yieldly = request.getParamValue("yieldly");
			String beginTime = CommonUtils.checkNull(request.getParamValue("beginTime"));
			String endTime = CommonUtils.checkNull(request.getParamValue("endTime"));
			String feeType = request.getParamValue("feeType");
			String dealerCode = CommonUtils.checkNull(request.getParamValue("dealerCode"));
			if(!dealerCode.equals("")){//截串加单引号
				String[] supp = dealerCode.split(",");
				dealerCode = "";
				for(int i=0;i<supp.length;i++){
					supp[i] = "'"+supp[i]+"'";
					if(!dealerCode.equals("")){
						dealerCode += "," + supp[i];
					}else{
						dealerCode = supp[i];
					}
				}
			}
			if(!"".equals(beginTime)){
				beginTime = beginTime + " 00:00:00";
			}
			if(!"".equals(endTime)){
				endTime = endTime + " 23:59:59";
			}
			//取得该用户拥有的产地权限
			String yieldlys = CommonUtils.findYieldlyByPoseId(logonUser.getPoseId());
			SpeciaExpensesBean bean = new SpeciaExpensesBean();
			bean.setFeeNo(feeNo);
			bean.setYieldly(yieldly);
			bean.setBeginTime(beginTime);
			bean.setEndTime(endTime);
			bean.setFeeType(feeType);
			bean.setDealerCode(dealerCode);
			bean.setCompanyId(String.valueOf(logonUser.getCompanyId()));
			bean.setYieldlys(yieldlys);
			
			Integer curPage = request.getParamValue("curPage") != null ? Integer
					.parseInt(request.getParamValue("curPage")): 1; 
			PageResult<Map<String, Object>> ps = dao.reauditQuerySpeciaExpenses(bean,curPage,Constant.PAGE_SIZE);
			
			act.setOutData("ps", ps);     
		}catch(Exception e) {
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"特殊费用提报");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	//重新审核页面初始化
	public void reauditDoInit(){
		ActionContext act = ActionContext.getContext();
		RequestWrapper req = act.getRequest() ;
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			String id = req.getParamValue("id");
			String feeType = req.getParamValue("feeType");
			Map<String, Object> map = dao.getSpeciaExpensesInfo(id);
			List<Map<String, Object>> list = dao.getSpeciaExpensesAudit(id);
			StandardVipApplyManagerDao smDao = new StandardVipApplyManagerDao();
			List<FsFileuploadPO> fileList= smDao.queryAttachFileInfo(id);
			List<Map<String, Object>> claim = dao.getFeeRoList(id);
			act.setOutData("map", map);
			act.setOutData("list", list);
			act.setOutData("fileList", fileList);
			act.setOutData("claim", claim);
			if(feeType.equals(Constant.FEE_TYPE_01)){
				act.setForword(reauditDo_01);
			}else{
				act.setForword(reauditDo_02);
			}
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.DELETE_FAILURE_CODE,"特殊费用删除");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
	//重新审核实现方法
	public void reauditSpeciaExpenses01(){
		ActionContext act = ActionContext.getContext();
		AclUserBean logonUser = (AclUserBean)act.getSession().get(Constant.LOGON_USER);
		try {
			RequestWrapper request = act.getRequest();
			String id = request.getParamValue("id");
			String remark = CommonUtils.checkNull(request.getParamValue("remark"));
			String auditFlag = request.getParamValue("auditFlag");
			String feeType = CommonUtils.checkNull(request.getParamValue("feeType"));
			String auditMoney = request.getParamValue("audit_money");//审核同意金额
			Date date = new Date();
			TtAsWrSpefeePO po = new TtAsWrSpefeePO();
			TtAsWrSpefeePO pp = new TtAsWrSpefeePO();
			if(auditFlag.equals("1")){
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_06));//已结算
			}else{
				po.setStatus(Integer.parseInt(Constant.SPEFEE_STATUS_05));//驳回
			}
			if(feeType.equals(Constant.FEE_TYPE_02)){
				String PASS_FEE = CommonUtils.checkNull(request.getParamValue("PASS_FEE"));//过路过桥
				String TRAFFIC_FEE = CommonUtils.checkNull(request.getParamValue("TRAFFIC_FEE"));//交通补助
				String QUARTER_FEE = CommonUtils.checkNull(request.getParamValue("QUARTER_FEE"));//住宿费
				String EAT_FEE = CommonUtils.checkNull(request.getParamValue("EAT_FEE"));//餐补
				String PERSON_SUBSIDE = CommonUtils.checkNull(request.getParamValue("PERSON_SUBSIDE"));//人员补助
				String declareSum = CommonUtils.checkNull(request.getParamValue("totalCount"));//总费用 
				po.setPassFee(Double.parseDouble(PASS_FEE));
				po.setTrafficFee(Double.parseDouble(TRAFFIC_FEE));
				po.setQuarterFee(Double.parseDouble(QUARTER_FEE));
				po.setEatFee(Double.parseDouble(EAT_FEE));
				po.setPersonSubside(Double.parseDouble(PERSON_SUBSIDE));
				po.setDeclareSum(Double.parseDouble(declareSum));
			}
			//审核同意金额
			if(StringUtil.notNull(auditMoney)){
				po.setDeclareSum(Double.parseDouble(auditMoney));
			}
			po.setUpdateBy(logonUser.getUserId());
			po.setUpdateDate(date);
			po.setAuditingOpinion(remark);//审核意见
			pp.setId(Long.parseLong(id));
			dao.update(pp, po);//修改TT_AS_WR_SPEFEE 工单费用

			TtAsWrSpefeeAuditingPO tp = new TtAsWrSpefeeAuditingPO();
			tp.setId(Long.parseLong(SequenceManager.getSequence("")));
			tp.setFeeId(pp.getId());
			tp.setAuditingDate(date);
			tp.setAuditingPerson(logonUser.getName());
			tp.setPresonDept(logonUser.getOrgId());
			if(auditFlag.equals("1")){//通过
				tp.setStatus(Constant.SPEFEE_STATUS_11);
			}else{//驳回
				tp.setStatus(Constant.SPEFEE_STATUS_12);
			}
			tp.setCreateBy(logonUser.getUserId());
			tp.setCreateDate(date);
			tp.setAuditingOpinion(remark);
			dao.insert(tp);
			
			/*String balanceId = request.getParamValue("balanceId");
			Integer count = dao.getCount(balanceId);
			TtAsWrClaimBalancePO ac = new TtAsWrClaimBalancePO();
			TtAsWrClaimBalancePO bc = new TtAsWrClaimBalancePO();
			ac.setId(Long.parseLong(balanceId));
			bc.setSpecFeeAuthCount(Long.parseLong(String.valueOf(count)));
			dao.update(ac, bc);*/
			
			act.setOutData("returnValue", 1);
		}catch(Exception e) {//异常方法
			BizException e1 = new BizException(act,e,ErrorCodeConstant.QUERY_FAILURE_CODE,"审核操作");
			logger.error(logonUser,e1);
			act.setException(e1);
		}
	}
}
